﻿namespace Linq;

public static class AnyWordUpperCase
{
    public static bool IsAnyWordUpperCase_Linq(IEnumerable<string> words)
    {
        return words.Any(word =>
            word.All(letter => char.IsUpper(letter)));
    }


    public static bool IsAnyWordUpperCase(IEnumerable<string> words)
    {
        foreach (var word in words)
        {
            bool areAllUpperCase = true;
            foreach (var letter in word)
            {
                if (char.IsLower(letter))
                {
                    areAllUpperCase = false;
                }
            }

            if (areAllUpperCase)
            {
                return true;
            }
        }

        return false;
    }
}